package com.jsmy.softapp.adapter;

import android.widget.ProgressBar;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.daimajia.numberprogressbar.NumberProgressBar;
import com.jsmy.softapp.R;
import com.jsmy.softapp.bean.AppTJListBean;

/**
 * Created with Android Studio.
 * User: wei_cd.
 * Date: 2018/4/18.
 * Time: 11:21.
 * To change for file | settings | file and code templates.
 */

public class HomeFragmentAdapter extends BaseQuickAdapter<AppTJListBean.DataBean.ListBean, BaseViewHolder> {

    public HomeFragmentAdapter() {
        super(R.layout.fragment_home_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, AppTJListBean.DataBean.ListBean item) {
        helper.setText(R.id.tv_title, item.getTitle());
        ProgressBar bar = (ProgressBar) helper.getView(R.id.m_bar);
        bar.setMax(item.getTgtvalue3());
        bar.setSecondaryProgress(item.getTgtvalue2());
        bar.setProgress(item.getTgtvalue1());

        NumberProgressBar vBar = helper.getView(R.id.m_vbar);
        vBar.setMax(item.getTgtvalue3() + item.getTgtvalue2() + item.getTgtvalue1());
        vBar.setProgress(item.getSjvalue());
    }
}
